//
//  ViewController.m
//  UI_Homework_08_02
//
//  Created by 黄威 on 16/5/12.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
//#import "ModelOfPic.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self create];
}


- (void)create{

self.navigationItem.title = @"🌲相册";

    
    
    //NSMutableArray *image = [NSMutableArray array];
    
    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button1 setImage:[UIImage imageNamed:@"1.jpg"] forState:UIControlStateNormal];
    button1.frame =CGRectMake(10, 70, 100, 100);
    [self.view addSubview:button1];
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button2 setImage:[UIImage imageNamed:@"2.jpg"] forState:UIControlStateNormal];
    button2.frame = CGRectMake(130, 70, 100, 100);
    [self.view addSubview:button2];
  
    UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button3 setImage:[UIImage imageNamed:@"3.jpg"] forState:UIControlStateNormal];
    button3.frame = CGRectMake(250, 70, 100, 100);
    [self.view addSubview:button3];
 
    
    UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button4 setImage:[UIImage imageNamed:@"4.jpg"] forState:UIControlStateNormal];
    button4.frame = CGRectMake(10,200, 100, 100);
    [self.view addSubview:button4];
    
    UIButton *button5 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button5 setImage:[UIImage imageNamed:@"5.jpg"] forState:UIControlStateNormal];
    button5.frame =CGRectMake(130, 200, 100, 100);
    [self.view addSubview:button5];


    [button2 addTarget:self action:@selector(hanle) forControlEvents:UIControlEventTouchUpInside];

}

- (void)hanle{

    
    SecondViewController *second = [[SecondViewController alloc]init];
    
    [self.navigationController pushViewController:second animated:YES];
    
    





}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
